/*
 * @Author: 浅浪 11352894+shallow-wave@user.noreply.gitee.com
 * @Date: 2024-10-15 18:45:22
 * @LastEditors: 浅浪 11352894+shallow-wave@user.noreply.gitee.com
 * @LastEditTime: 2024-10-15 18:50:45
 * @FilePath: /gateway/test/app_buffer_test.c
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include "app_buffer.h"
#include "log/log.h"



int main()
{
	/*写入数据*/
	Buffer *buffer = app_buffer_init(12);
	/*写入4个数据*/
	app_buffer_write(buffer, "abcd", 4);
	/*写入5个数据*/
	app_buffer_write(buffer, "efghi", 5);

	/*读取4个数据*/ 
	char data[4];
	app_buffer_read(buffer, data, 4);
	log_debug("data:%s", data);
	/*写入6个数据*/
	app_buffer_write(buffer, "jklmnop", 6);
	/*读取5个数据*/
	char data2[5];
	app_buffer_read(buffer, data2, 5);
	log_debug("data:%s", data2);
	/*读取6个数据*/
	char data3[6];
	app_buffer_read(buffer, data3, 6);
	log_debug("data:%s", data3);
	
	return 0;
}